(DEFUN c:layoffall ( / allay_list steplayer steplayobj x)
  (setq allay_list (list (CDR (ASSOC 2 (TBLNEXT "LAYER" T)))))
  (while (setq steplayer (tblnext "layer"))(setq allay_list (append allay_list (list (CDR (ASSOC 2 steplayer))))))
  (mapcar '(lambda (x) (setq steplayobj (entget (tblobjname "layer" x)))(setq steplayobj (subst (cons 62 (- (abs (cdr (assoc 62 steplayobj)))))(assoc 62 steplayobj)steplayobj))(entmod steplayobj)) allay_list)
  (princ)
)
(DEFUN c:layonall ( / allay_list steplayer steplayobj x)
  (setq allay_list (list (CDR (ASSOC 2 (TBLNEXT "LAYER" T)))))
  (while (setq steplayer (tblnext "layer"))(setq allay_list (append allay_list (list (CDR (ASSOC 2 steplayer))))))
  (mapcar '(lambda (x) (setq steplayobj (entget (tblobjname "layer" x)))(setq steplayobj (subst (cons 62 (abs (cdr (assoc 62 steplayobj))))(assoc 62 steplayobj)steplayobj))(entmod steplayobj)) allay_list)
  (princ)
)